package com.proxy.service;

import com.proxy.mapper.TOrderMapper;
import com.proxy.model.TOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;

@Service
public class OrderService {


    @Autowired
    private TOrderMapper tOrderMapper;

    public void insert() {

        for (int i = 0; i <= 1000; i++) {
            TOrder tOrder = new TOrder();
            tOrder.setOrderId(i * 100L);
            tOrder.setUserId((long) i);
            tOrder.setFeature(UUID.randomUUID().toString());
            tOrderMapper.insert(tOrder);
        }
    }

    public TOrder getOrder(Long orderId) {
        return tOrderMapper.selectByPrimaryKey(orderId);
    }


}
